package com.ruoyi.project.yuwen.audioblack.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.yuwen.audioblack.domain.AudioBlack;
import com.ruoyi.project.yuwen.audioblack.mapper.AudioBlackMapper;
import com.ruoyi.project.yuwen.audioblack.service.IAudioBlackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 封禁用户Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-02-24
 */
@Service
@DataSource(DataSourceType.KKCUSER)
public class AudioBlackServiceImpl implements IAudioBlackService {

    @Autowired
    private AudioBlackMapper audioBlackMapper;

    /**
     * 查询封禁用户
     *
     * @param id 封禁用户ID
     * @return 封禁用户
     */
    @Override
    public AudioBlack selectAudioBlackById(Long id) {
        return audioBlackMapper.selectAudioBlackById(id);
    }

    /**
     * 查询封禁用户列表
     *
     * @param audioBlack 封禁用户
     * @return 封禁用户
     */
    @Override
    public List<AudioBlack> selectAudioBlackList(AudioBlack audioBlack) {
        return audioBlackMapper.selectAudioBlackList(audioBlack);
    }

    /**
     * 新增封禁用户
     *
     * @param audioBlack 封禁用户
     * @return 结果
     */
    @Override
    public int insertAudioBlack(AudioBlack audioBlack) {
        return audioBlackMapper.insertAudioBlack(audioBlack);
    }

    /**
     * 修改封禁用户
     *
     * @param audioBlack 封禁用户
     * @return 结果
     */
    @Override
    public int updateAudioBlack(AudioBlack audioBlack) {
        return audioBlackMapper.updateAudioBlack(audioBlack);
    }

    /**
     * 删除封禁用户对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAudioBlackByIds(String ids) {
        return audioBlackMapper.deleteAudioBlackByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除封禁用户信息
     *
     * @param id 封禁用户ID
     * @return 结果
     */
    @Override
    public int deleteAudioBlackById(Long id) {
        return audioBlackMapper.deleteAudioBlackById(id);
    }
}
